package com.company.cloud.user.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import org.springframework.stereotype.Component;

import com.company.cloud.user.modules.api.request.RegisterNumDataRequest;
import com.company.cloud.user.modules.api.response.RegisterNumDataResponse;
import com.company.cloud.user.modules.api.service.UserDataRemoteService;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;

import java.util.Map;
import java.util.Set;

@Log4j2
@Component
public class UserDataRemoteServiceFallbackFactory implements FallbackFactory<UserDataRemoteService>{
	
	@Override
	public UserDataRemoteService create(Throwable cause) {
		return new UserDataRemoteService() {
			@Override
			public BaseClientResult<RegisterNumDataResponse> registerUserNum(RegisterNumDataRequest params) {
				return BaseClientResult.callbackError();
			}
			@Override
			public BaseClientResult<Map<Integer, Integer>> customerCount(Integer userId) {
				return BaseClientResult.callbackError();
			}
			@Override
			public BaseClientResult<Map<Integer, Integer>> customerCountMap(Set<Integer> userId) {
				return BaseClientResult.callbackError();
			}
			@Override
			public BaseClientResult<String> wjjTest(String code) {
				return BaseClientResult.callbackError();
			}
		};
	}

}
